package jsu.lipengcheng.trafficnet.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class TicketExportDTO {

    @ExcelProperty("罚单编号")
    private String fineNumber;

    @ExcelProperty("用户ID")
    private Integer userId;

    @ExcelProperty("车辆ID")
    private Integer carId;

    @ExcelProperty("扣分分数")
    private String score;

    @ExcelProperty("罚款")
    private Integer fine;

    @ExcelProperty("扣分时间")
    private String createTime;

    @ExcelProperty("支付状态")
    private Integer status;

    public static TicketExportDTO from(Ticket ticket) {
        return new TicketExportDTO(
                ticket.getFineNumber(),
                ticket.getUserId(),
                ticket.getCarId(),
                ticket.getUpdataScore(), // 注意拼写是否是 getUpdateScore?
                ticket.getFine(),
                ticket.getCreateTime().toString(), // 假设是 LocalDateTime 或 Date
                ticket.getStatus()
        );
    }

    // getter / setter
}